package com.ushine.design.design.c_behavioral_pattern.i_strategy.b_example;

public class Client {
    public static void main(String[] args) {
        MovieTicket mt = new MovieTicket();
        double originalPrice = 60.0;
        double currentPrice;

        mt.setPrice(originalPrice);
        System.out.println("原价为：" + originalPrice);
        System.out.println("--------------------------");

        Discount discount = new StudentDiscount();
        mt.setDiscount(discount);
        currentPrice = mt.getPrice();
        System.out.println("折后价：" + currentPrice);
        System.out.println();

        discount = new VIPDiscount();
        mt.setDiscount(discount);
        currentPrice = mt.getPrice();
        System.out.println("折后价：" + currentPrice);
        System.out.println();

        discount = new ChildrenDiscount();
        mt.setDiscount(discount);
        currentPrice = mt.getPrice();
        System.out.println("折后价：" + currentPrice);

    }
}
